package com.example.springboot007servletsfilterslisteners.servlet;

import jakarta.servlet.*;
import jakarta.servlet.annotation.WebFilter;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;

import java.io.IOException;

/**
 * @description: TODO
 * @author: uu
 * @data: 2023/7/3 下午 11:16
 * @version: v1.0
 */
//@WebFilter(urlPatterns = "/*")
public class FilterServlet implements Filter {
    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        String requestURI = ((HttpServletRequest) request).getRequestURI().toString();
        System.out.println("硬编码方式实现过滤器过滤器执行了"+requestURI);
        chain.doFilter(request,response);
    }
}
